#include<iostream>
#include <memory>
#include "udp_client.hpp"

using namespace std;
using namespace ns_client;

void Usage(char* argv[])
{
  cout << "Usage:" << endl;
  cout << "\t" << argv[0] << " ServerIP ServerPort" << endl;
}

int main(int argc, char* argv[])
{
  if(argc != 3)
  {
    Usage(argv);
    return USAGE_ERR;
  }


  unique_ptr<UdpClient> usvr(new UdpClient(string(argv[1]), atoi(argv[2])));

  //首先初始化服务器
  usvr->InitClient();
  
  //然后启动服务器
  usvr->StartClient();

  return 0;
}
